import {Panel, LayerLink} from 'comps/common';
import {Table} from 'antd';
import * as React from 'react';
import MachineDetail from '../containers/machine-detail';
import ApplicationDetail from '../containers/application-detail';

const ConsumerList = ({consumerList}) => {

  const columns = [
    {
      title: '机器IP',
      dataIndex: 'address',
      key: 'address',
      render(address){
        return <LayerLink component={MachineDetail} data={{address:address}}>{address}</LayerLink>
      }
    }, {
      title: '应用名',
      dataIndex: 'application',
      key: 'application',
      render(app){
        return <LayerLink component={ApplicationDetail} data={{application:app}}>{app}</LayerLink>
      }
    }, {
      title: '状态',
      dataIndex: 'status',
      key: 'status'
    }, {
      title: '检查',
      dataIndex: 'status1',
      key: 'status1'
      //}, {
      //  title: '操作',
      //  key: 'operation',
      //  render() {
      //    return '管理';
      //  }
    }
  ];

  return (
    <Panel title="消费者列表">
      <Table dataSource={consumerList} columns={columns} pagination={false} size="middle" rowKey={record => record.id}/>
    </Panel>
  )
}

export default ConsumerList;
